package Campus.help.task.fegin;

import Campus.help.common.utils.R;
import Campus.help.task.entity.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

@FeignClient(value = "Campus-user")
public interface UserOpenFeginService {
    @GetMapping("/user/userInfo/getUserInfo/{userId}")
//    public UserInfo getUserInfoById(Long userid);
    public UserInfo getUserInfoById(@PathVariable("userId")Long userId);

    @GetMapping("/user/userInfo/getUserAvatar/{id}")
    public String getUserAvatarByid(@PathVariable("id")Long id);

    @PostMapping("/user/count/payfor")
    public R payForMoney(@RequestParam("amount") BigDecimal amount);

    @PostMapping("/user/count/return")
    public R returnAmount(@RequestParam("amount")BigDecimal amount,@RequestParam("userId")Long userId);

    @PostMapping("/user/count/complete")
    public R complete(@RequestParam("amount")BigDecimal amount,@RequestParam("userId")Long userId);

    @PostMapping("/user/userInfo/updateRate")
    public R updateRate(@RequestParam("id")Long id, @RequestParam("rate")BigDecimal rate);
}
